package com.kaifamiao.thread.d0928.pm;

import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;

public class BroadcastClient {

    public static void main(String[] args) throws Exception {
        DatagramSocket socket = new DatagramSocket();

        byte[] bytes = "10086".getBytes();
        InetAddress address = InetAddress.getByName("255.255.255.255");
        int port = 8888;
        DatagramPacket packet = new DatagramPacket(bytes, bytes.length, address, port);

        socket.send(packet);

        System.out.println("发送成功");

    }
}
